<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String url = request.getScheme() + "://" + request.getServerName()
			+ request.getRequestURI();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />
		<title>数据维护</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<%@ include file="/html/custom/header.jsp"%>

		<link type="text/css" href="<%=basePath%>/html/css/gm/user.css"
			rel="stylesheet" />
		<style>
		.td-op{width: 280px;}
		</style>	
	</head>
	<body>
		<!-- 导航 -->
		<s:action name="showTopNav" executeResult="true" namespace="/user"></s:action> 
		<!-- /导航 -->  
        
		<div id="content">
			<!-- 单条删除辅助html -->
			<%@ include file="/html/custom/formDel.jsp"%>
			<form id="dbForm" action="" method="post" >
			<!-- toolbar -->
			<div class="toolbar">
				<span id="btnset" class="btnset"><input type="button" value="备 份" onclick="javascript:submitForm();" />
				</span>
			</div>
			<!-- 数据表通用格式 -->
			
			<div class="datagird">
				<table class="ui-widget ui-widget-content">
					<thead>
						<tr class="ui-widget-header ">
							
							<th>
								数据文件
							</th>
							<th>
								操作
							</th>
						</tr>
					</thead>
					<tbody>
							<s:iterator value="#request.fileNames" status="arr">
							<tr>
								<td>
								<img src="html/images/db.gif" />
							<s:property />
								</td>
								<td>
								<a 
								href="sys/deleteDB.action?fileName=<s:property />"> <img
									border="0" src="html/images/del.gif" /> 删除</a>&nbsp;&nbsp;<a class="font3"
								href="javascript:submitFormrestore('<s:property />');"> <img
									border="0" src="html/images/trac.gif"> 恢复</a>&nbsp;&nbsp;
							<a  href="html/backup/<s:property />"> <img
									border="0" src="html/images/icon_go_down.gif" />下载</a>
								</td>
								
							</tr>
							</s:iterator>
					</tbody>
				</table>
			</div>
			
			</form>
		</div>
		<div id="loading"></div>
		<div id="mask"></div>
		<div id="msg"></div>
  </body>
  <script type="text/javascript">
	function submitForm(){
		
		document.all.dbForm.action="/swss/sys/backUpDB.action";
		document.all.dbForm.submit();
		document.body.innerHTML="<div align=\"center\">数据备份中,请稍后……<br/><img src='html/images/loading_32x32.gif'></div>";
	}
	function submitFormrestore(fileName){
		
		document.all.dbForm.action="/swss/sys/restoreDB.action?fileName="+fileName;
		document.all.dbForm.submit();
			
		document.body.innerHTML="<div align=\"center\">数据恢复中,请稍后……<br/><img src='html/images/loading_32x32.gif'></div>";
		
	}
	</script>
</html>